package com.epsoft.odin7cj.flow.enums;

/**
 * 授权模块返回码（编码规则：05 + 2位功能编号  + 3位错误编号）
 * 01 流程管理
 * 02 流程定义
 * 03 流程实例
 * @author 胡义振
 * @date 2018-03-18
 */
public enum FlowRetCodeEnum {
	
	
	RET_CODE_0501001("0501001","模板ID为空"),
	RET_CODE_0501002("0501002","模板内容为空"),
	
	RET_CODE_0502001("0502001","流程定义key不能为空"),
	RET_CODE_0502002("0502002","流程定义KEY不同，不能启动该流程"),
	RET_CODE_0502003("0502003","流程定义不存在"),
	RET_CODE_0502004("0502004","用户ID不能为空"),
	
	RET_CODE_0503001("0503001","没有历史实例，不能进行退回操作"),
	RET_CODE_0503002("0503002",""),
	
	RET_CODE_0599999("RET_CODE_0199999","其他错误");
	
	private String code;
	private String message;
	
	
	FlowRetCodeEnum(String code,String message){
		this.code = code;
		this.message = message;
	}
	
	public static String getRetCodeName(String retErrCode){
		String rtnRetErrCode = "";
		for (FlowRetCodeEnum authRetCodeEnum : FlowRetCodeEnum.values()) {
			if(authRetCodeEnum.code.equals(retErrCode)){
				rtnRetErrCode = authRetCodeEnum.message;
			}
	    }
		return rtnRetErrCode;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}


}
